import 'package:flutter_ahj_app/app/APIConfiguration.dart';
import 'package:flutter_ahj_app/base/basewidget/HttpUtils/HttpClient.dart';
import 'package:flutter_ahj_app/base/basewidget/HttpUtils/HttpNoTokenClient.dart';
import 'package:flutter_ahj_app/base/basewidget/HttpUtils/HttpOtherClient.dart';
import 'package:flutter_ahj_app/base/basewidget/HttpUtils/HttpKCBaseConst.dart';

class HttpRequest {
  /*
    * 用户登录（密码）
    * */
  static Stream userlogIn(String name, String password) {
    Map<String, String> map = new Map();
    map["phone"] = name;
    map["password"] = password;
    return HttpNoTokenClient.getInstance().post("admin/v1/sso-login/pwd", map);
  }

  /*
    * 用户退出登录
    * */
  static Stream userlogOut() {
    return HttpClient.getInstance().get("ahtc/v1/sso-login/logout", params: null);
  }

  /*
    * 修改密码
    * */
  static Stream changePassword(Map map) {
    return HttpClient.getInstance().post("admin/v1/account/pwd/change", map);
  }

  /*
    * 用户信息
    * */
  static Stream userInfoRequest() {
    return HttpClient.getInstance().get("ahtc/v1/account/getAccountById", params: null);
  }
  /*
    * 查询机构
    * */
  static Stream tenantApproveRequest() {
    return HttpClient.getInstance().get("admin/v1/tenant/approve", params: null);
  }


  /*
    * 发送验证码
    * */
  static Stream sendCodeApi(Map map) {
    return HttpClient.getInstance().post("ahtc/v1/sso-login/send-sms-code", map);
  }

  /*
    * 校验验证码
    * */
  static Stream checkCodeApi(Map map) {
    return HttpClient.getInstance().post("admin/v1/sso-login/check-sms-code", map);
  }

  /*
    * 重置密码
    * */
  static Stream resetPasswordApi(Map map) {
    return HttpClient.getInstance().post("admin/v1/sso-login/pwd/reset", map);
  }

  /*
    * 退出登录
    * */
  static Stream loginOutApi() {
    return HttpClient.getInstance().get("ahtc/v1/sso-login/logout", params: null);
  }

  /*
    * 查询企业信息
    * */
  static Stream qyxxApi() {
    return HttpClient.getInstance().get("ahtc/v1/tenant/app/tenant-list", params: null);
  }

  /*
    * 切换身份
    * */
  static Stream qhsfApi(var tenantId) {
    var map = {
      'tenantId': tenantId,
    };
    return HttpClient.getInstance().post("ahtc/v1/sso-login/change-tenant", map);
  }

  /*
    * 用户注册
    * */
  static Stream userRegist(
      String name,
      String password,
      String locationProvince,
      String locationProvinceCode,
      String locationCity,
      String locationCityCode,
      String locationDistrict,
      String locationDistrictCode) {
    Map<String, String> map = new Map();
    map["mobile"] = name;
    map["confirmPassword"] = password;
    map["password"] = password;
    map["province"] = locationProvince;
    map["provinceCode"] = locationProvinceCode;
    map["city"] = locationCity;
    map["cityCode"] = locationCityCode;
    map["district"] = locationDistrict;
    map["districtCode"] = locationDistrictCode;
    return HttpNoTokenClient.getInstance()
        .post("admin/v1/ahj/users/register", map);
  }

  /*
    * 身份认证
    * */
  static Stream userCardauto(String name) {
    Map<String, dynamic> map = new Map();
    map["url"] = name;
    map["urlIs"] = true;
    map["backIs"] = false;
    return HttpClient.getInstance()
        .post("admin/v1/certification/card-auto", map);
  }

  /*
    * 身份反面认证
    * */
  static Stream userCardautoback(String name) {
    Map<String, dynamic> map = new Map();
    map["url"] = name;
    map["urlIs"] = true;
    map["backIs"] = true;
    return HttpClient.getInstance()
        .post("admin/v1/certification/card-auto", map);
  }

  /*
    * 获取直播互动消息
    * */
  static Stream userGetchatmessage(String scheduleId) {
    Map<String, String> map = new Map();
    map["id"] = scheduleId;
    return HttpNoTokenClient.getInstance()
        .get("/platform/v1/live/getchatmessage", params: map);
  }

  /*
    * 发送直播互动消息
    * */
  static Stream userSendchatmessage(
      String message, String messageTime, String scheduleId, String userName) {
    Map<String, String> map = new Map();
    map["message"] = message;
    map["messageTime"] = messageTime;
    map["scheduleId"] = scheduleId;
    map["userName"] = userName;
    return HttpClient.getInstance()
        .post("/platform/v1/live/sendchatmessage", map);
  }

  /*
    * 获取用户实名认证信息
    * */
  static Stream getuserCardMessage() {
    Map<String, String> map = new Map();
    return HttpClient.getInstance()
        .get("admin/v1/certification/card", params: map);
  }

  /*
    * 身份认证上传
    * */
  static Stream userCard(
      String name,
      String cardno,
      String cardFront,
      String cardBack,
      String address,
      String authority,
      String birthday,
      String dateOfIssue,
      String nation,
      String validity,
      String sex) {
    Map<String, String> map = new Map();
    map["address"] = address;
    map["authority"] = authority; // 签发机关
    map["birthday"] = birthday; // 生日
    map["backFilePath"] = cardBack; //   反面路径
    map["coverFilePath"] = cardFront; //     正面路径
    map["dateOfIssue"] = dateOfIssue; // 签发日期
    map["nation"] = nation; //  民族
    map["validity"] = validity; // 失效日期
    map["sex"] = sex; //  性别
    map["name"] = name;
    map["certificationNo"] = cardno;
    map["cardFront"] = cardFront;
    map["cardBack"] = cardBack;
    map['source'] = "zjzxapp";
    return HttpClient.getInstance().post("admin/v1/certification/card", map);
  }

  /*
    * 银行卡认证
    * */
  static Stream userbardCard(String id, String cardno) {
    Map<String, dynamic> map = new Map();

    map["id"] = (id != null) ? int.parse(id) : null;
    map["bankCard"] = cardno;
    return HttpClient.getInstance().post("admin/v1/ahj/users/bank", map);
  }

  /*
    * 获取验证吗接口
    * mobile 手机号
    *
    * */
  static Stream getuserCheckPassword(String mobile) {
    Map<String, String> map = new Map();
    map["mobile"] = mobile;
    map["smsType"] = "commonCode";
    return HttpNoTokenClient.getInstance()
        .get("cooperation/v1/message/sms", params: map);
  }

  /*
    * 验证验证吗接口
    * mobile 手机号
    *
    * */
  static Stream userCheckCode(String mobile, String code) {
    Map<String, String> map = new Map();
    map["mobile"] = mobile;
    map["code"] = code;
    map["smsType"] = "commonCode";
    return HttpNoTokenClient.getInstance()
        .get("cooperation/v1/message/sms/check", params: map);
  }

  /// 获取个人信息
  static Stream userInfo() {
    String url = userInfoApi;
    return HttpClient.getInstance().get(url, params: null);
  }

  ///需求方 资金管理 交易记录
  static Stream tradeRecord(String current, String date, [String size]) {
    String _size = size ?? '15';
    String url = xqf_trade_record;
    Map<String, String> map = new Map();
    map["current"] = current;
    map["date"] = date;

    /// yyyy-MM
    map["size"] = _size;

    return HttpClient.getInstance().get(url, params: map);
  }

  //newXqf_trade_record
  ///需求方 资金管理 交易记录
  /// 交易明细
  static Stream transList(Map map) {
    return HttpClient.getInstance().get("ahj/v1/account-records", params: map);
  }

  // 工程师收入列表
  static Stream incomeList(Map map) {
    return HttpClient.getInstance()
        .get("ahj/v1/account-records/income", params: map);
  }

  // 工程师提现列表
  static Stream deposList(Map map) {
    return HttpClient.getInstance()
        .get("ahj/v1/account-records/withdraw", params: map);
  }
// 获取提现开始日
  static Stream getTXDay() {
    return HttpClient.getInstance()
        .get("ahj/v1/withdraw/withdrawalDay", params: null);
  }
  // 工程师创建提现订单
  static Stream createOrder(Map map) {
    return HttpClient.getInstance().post("ahj/v1/withdraw/create", map);
  }

  /// 提现查询 余额和当月已提现
  static Stream queryMoneyInfo() {
    return HttpClient.getInstance().get("ahj/v1/withdraw/query");
  }

  ///工程师 资金管理 交易记录
  static Stream ledgersIncome(String current, String date, [String size]) {
    String _size = size ?? '15';
    String url = gcs_ledgers_income;
    Map<String, String> map = new Map();
    map["current"] = current;
    map["date"] = date;

    /// yyyy-MM
    map["size"] = _size;

    return HttpClient.getInstance().get(url, params: map);
  }

  /// 拒单之后 重新指派
  static Stream transmit(String id, String engineerId) {
    String url = put_transmit;
    Map<String, String> map = new Map();
    map["id"] = id;
    map["engineerId"] = engineerId;
    return HttpClient.getInstance().put(url, map);
  }

  ///获取轮播图
  static Stream bannerImage() {
    String url = bannerNowApi;

    Map<String, String> map = new Map();
//    map["mobile"] = mobile;

    return HttpNoTokenClient.getOpenInstance('zixun').get(url, params: map);
  }

  /// 直播回放列表
  static Stream livePlayList(int size, int current) {
    String url = livePlayListApi;
    Map<String, dynamic> map = new Map();
    map['current'] = current;
    map['size'] = size;
    return HttpNoTokenClient.getInstance().get(url, params: map);
  }

  /// 正在直播列表
  static Stream liveNowList() {
    String url = liveNowListApi;
    return HttpNoTokenClient.getInstance().get(url, params: null);
  }

  /// 项目管理列表
  static Stream yhpcProductList(Map map) {
    String url = yhpcProductApi;
    return HttpClient.getInstance().get(url, params: map);
  }

 
  /// 正在直播列表
  static Stream liveNumber(String id) {
    String url = liveNumberApi;
    Map<String, String> map = new Map();
    map["id"] = id;
    return HttpNoTokenClient.getInstance().get(url, params: map);
  }

  ///版本更新
  static Stream checkVersion(Map map) {
    return HttpClient.getInstance()
        .get("/xay/v1/app/sys/app-version/check", params: map);
  }

  ///获取cookie
  static Stream ck() {
    return HttpClient.getInstance().get(ck_url, params: {});
  }

  ///鑫微客实名认证
  static Stream wekeCer() {
    return HttpClient.getInstance().get('admin/v1/certification/weke', params: {});
  }

  ///项目列表
  static Stream proList(Map map, bool isLogin) {
    String url = isLogin ? proListApiLogin : proListApi;
    if (isLogin) {
      return HttpClient.getInstance().get(url, params: map);
    } else {
      return HttpNoTokenClient.getInstance().get(url, params: map);
    }
  }
  ///合同列表 工程师
  ///zjzx/contract
  ///get
  static Stream getZjzxContract(Map map) {
    String url = zjzxContract;
    return HttpClient.getInstance().get(url, params: map);
  }
  /// 合同管理 - 接单
  /// /v1/zjzx/contract/order/{id}
  /// 接单
  /// get
   static Stream getZjzxContractOrder(String id) {
    String url = zjzxContractOrder+id;
  
    return HttpClient.getInstance().get(url);
  }

  ///优选项目
  ///zjzx/contract
  ///get
  static Stream getYxxmList(Map map) {
    String url = 'ahj/v1/zjzx/contract/hall';
    return HttpClient.getInstance().get(url, params: map);
  }

  /// 合同管理 - 状态
  /// /v1/zjzx/contract/order/{id}
   static Stream getContractStatus() {
    String url = 'ahj/v1/zjzx/contract/status';
    var map = {
      'role': '1'
    };
    return HttpClient.getInstance().get(url, params: map);
  }

  /// 派单
  /// /v1/zjzx/contract/dispatch/{id}
   static Stream pD(String id) {
    String url = 'ahj/v1/zjzx/contract/supplierDispatch';
    var map = {
      'id': id
    };
    return HttpClient.getInstance().get(url, params: map);
  }

  /// 撤回
  /// /v1/zjzx/contract/supplierDispatch/revoke
   static Stream cH(String id) {
    String url = 'ahj/v1/zjzx/contract/supplierDispatch/revoke';
    var map = {
      'id': id
    };
    return HttpClient.getInstance().get(url, params: map);
  }

  ///项目列表
  static Stream proInfo(String id) {
    var data = {
      'a': "a",
    };
    String url = proInfoApi + id;
    return HttpClient.getInstance().get(url, params: data);
  }

  /// 资源 菜单
  static Stream moduler(Map map) {
    String url = ZYModule;
    return HttpNoTokenClient.getInstance().get(url, params: map);
  }
  /// 资源 菜单
  static Stream modulerV2(Map map) {
    String url = ZYModulev3;
    return HttpNoTokenClient.getInstance().get(url, params: map);
  }
  /// 获取加入邀请
  static Stream joinCompany() {
    return HttpClient.getInstance().get("ahj/v1/zjzx/supplier/staff/fetchJoinInvite", params: null);
  }
  /// 同意或拒绝加入邀请
  static Stream joinResult(Map map) {
    return HttpClient.getInstance().post("ahj/v1/zjzx/supplier/staff/joinResult?supplierStaffRefId=${map['supplierStaffRefId']}&joinFlag=${map['joinFlag']}", null);
  }
  /// 分享检测
  static Stream getShareCheckData(Map map) {
    String url = map["url"];
    return HttpNoTokenClient.getInstance().get(url, params: map);
  }

  /// 意见反馈
  static Stream systemFeedback(String content, String username) {
    Map<String, String> map = new Map();
    map["content"] = content;
    map["username"] = username;

    String url = system_feedback;
    return HttpClient.getInstance().post(url, map);
  }

  /// 获取个人详细信息
  static Stream myInfo() {
    String url = myInfoUrl;
    return HttpClient.getInstance().get(url, params: null);
  }

  /// 获取个人详细信息
  static Stream uploadMyCers(String cers) {
    Map<String, String> map = new Map();
    map["certificates"] = cers;
    String url = uploadMyCersUrl;
    return HttpClient.getInstance().post(url, map);
  }

  /// 获取个人擅长领域
  static Stream getTypes(Map map) {
    String url = getTypesUrl;
    return HttpClient.getInstance().get(url, params: map);
  }

  /// 保存个人擅长领域
  static Stream saveTypes(Map map) {
    String url = saveTypesUrl;
    return HttpClient.getInstance().post(url, map);
  }

  /// 保存个人信息
  static Stream saveMyInfo(Map map) {
    String url = saveInfoUrl;
    return HttpClient.getInstance().post(url, map);
  }

  ///切换角色
  static Stream usersRole(int role) {
    Map<String, int> params = new Map();
    params["role"] = 2;
    String url = users_role_url;
    return HttpClient.getInstance().post(url, params);
  }

  ///更新工程师个人简历
  static Stream usersPerson(String personalProfile) {
    Map<String, String> params = new Map();
    params["personalProfile"] = personalProfile;
    String url = users_person_url;
    return HttpClient.getInstance().post(url, params);
  }

  ///更新公司简历
  static Stream usersCompany(String companyProfile) {
    Map<String, String> params = new Map();
    params["companyProfile"] = companyProfile;
    String url = users_company_url;
    return HttpClient.getInstance().post(url, params);
  }

  ///更新公司个人简历
  static Stream usersPublishPerson(String personalProfilePublish) {
    Map<String, String> params = new Map();
    params["personalProfilePublish"] = personalProfilePublish;
    String url = users_publish_person_url;
    return HttpClient.getInstance().post(url, params);
  }

  ///修改密码
  static Stream usersPWD(String oldPassword, String newPassword) {
    Map<String, String> params = new Map();
    params["oldPassword"] = oldPassword;
    params["newPassword"] = newPassword;
    String url = users_pwd_url;
    return HttpClient.getInstance().put(url, params);
  }

  ///修改默认密码
  static Stream changeDefaultPwd(String newPassword) {
    Map<String, String> params = new Map();
    params["newPassword"] = newPassword;
    String url = change_default_pwd;
    return HttpClient.getInstance().put(url, params);
  }

  ///需求方 基本信息
  //  'locationProvince': _provinceSzqy,
  //  'locationProvinceCode': _provinceCodeSzqy,
  //  'locationCity': _citySzqy,
  //  'locationCityCode': _cityCodeSzqy,
  //  'locationDistrict': _areaSzqy,
  //  'locationDistrictCode': _areaCodeSzqy,
  static Stream usersPublish(
      String nickName,
      String name,
      String avatar,
      String companyName,
      String locationProvince,
      String locationProvinceCode,
      String locationCity,
      String locationCityCode,
      String locationDistrict,
      String locationDistrictCode) {
    Map<String, String> params = new Map();
    params["nickName"] = nickName;
    params["name"] = name;
    params["avatar"] = avatar;
    params["companyName"] = companyName;
    params["locationProvince"] = locationProvince;
    params["locationProvinceCode"] = locationProvinceCode;
    params["locationCity"] = locationCity;
    params["locationCityCode"] = locationCityCode;
    params["locationDistrict"] = locationDistrict;
    params["locationDistrictCode"] = locationDistrictCode;

    String url = users_publish_url;
    return HttpClient.getInstance().post(url, params);
  }

  ///获取验证码
  static Stream getCheckCode(String phone) {
    Map<String, dynamic> params = new Map();
    params["phone"] = phone;
    String url = get_check_code;
    return HttpNoTokenClient.getInstance().post(url, params);
  }

  ///验证码登录
  static Stream checkCodeLogin(String phone, String code) {
    Map<String, dynamic> params = new Map();
    if(phone!=''){
      params["phone"] = phone;
    }
    params["phoneCaptcha"] = code;
    String url = check_code_login;
    return HttpNoTokenClient.getInstance().post(url, params);
  }

  ///一键登录
  static Stream yiJianLogin(String code) {
    Map<String, dynamic> params = new Map();
    params["code"] = code;
    return HttpNoTokenClient.getInstance().post('admin/v1/sso-login/one-click-login', params);
  }

  ///获取省市区
  static Stream getAddress(Map map) {
    String url = get_address;
    return HttpNoTokenClient.getInstance().get(url, params: map);
  }

  /// /v1/app/agreement
  /// 获取协议
  /// get
  /// type string 协议类型 1:平台协议 2:自雇者协议
 static Stream getAppAgreement({String type}) {
   var params = {
     'type':type
   };
    String url = get_app_agreement;
    return HttpNoTokenClient.getInstance().get(url,params: params);
  }

  ///获取省市区多选
  static Stream getQuYuAddress() {
    String url = get_quyuaddress;
    return HttpClient.getInstance().get(url, params: {'level': '2'});
  }

  ///获取管理分类数据
  static Stream getGlflData(bool isFirst, String parentcode) {
    String url = isFirst ? "platform/v1/manageType/manage-list" : "platform/v1/manageType/manage-link/${parentcode}";
    var map;
    if (!isFirst) {
      map = {
        'parentcode': parentcode
      };
    }
    return HttpClient.getInstance().get(url, params: map);
  }

  ///获取省模糊查询
  static Stream getProvinceAddress(Map map) {
    String url = "ahj/v1/bank/province";
    return HttpClient.getInstance().get(url, params: map);
  }

  ///获取市模糊查询
  static Stream getCityAddress(Map map) {
    String url = "ahj/v1/bank/city";
    return HttpClient.getInstance().get(url, params: map);
  }

  ///获取开户行
  static Stream getKaihuhang(Map map) {
    String url = get_kaihuhang;
    return HttpClient.getInstance().get(url, params: map);
  }

  ///获取银行卡列表
  static Stream getBankList(Map map) {
    String url = get_bank_list;
    return HttpClient.getInstance().get(url, params: map);
  }

  ///删除银行卡
  static Stream delBank(String id) {
    String url = del_bank + id;
    return HttpClient.getInstance().delete(url, params: null);
  }

  ///********************************** 工程师认证**********************************************/
////v1/certification/feign/person
  /// 获取个人认证列表
  /// get
  static Stream certificationFeignPerson(String current, String key,
      [String size]) {
    String url = gcs_certification_feign_person;

    Map<String, dynamic> params = new Map();
    params['current'] = current;

    ///当前页码

    params['key'] = key;

    ///姓名 手机号

    params['size'] = '15';

    ///分页大小

    return HttpClient.getInstance().get(url, params: params);
  }

  ////v1/certification/app/person
  /// 职称认证 和 职业资格认证
  /// post
  static Stream certificationFeignPersonPost(Map params) {
    String url = gcs_certification_feign_person_post;
    return HttpClient.getInstance().post(url, params);
  }

  /// 服务列表
  static Stream fwlbPost() {
    return HttpClient.getOpenInstance('zixun').get("ahtc/v1/expert/configServiceList", params: null);
  }

  /// 提交认证
  static Stream submitApi(var map) {
    return HttpClient.getOpenInstance('zixun').post("ahtc/v1/expert/saveOrUpdate", map);
  }

  /// 认证详情
  static Stream certDetailApi(var map) {
    return HttpClient.getOpenInstance('zixun').get("ahtc/v1/expert/baseDetailById", params: map);
  }

  /// /v1/dict
  /// 获取证书类别和证书级别
  /// get
  static Stream v1DictGet(String id, [String dictName]) {
    String url = gcs_v1_dict_get;

    Map<String, dynamic> params = new Map();
    params['current'] = '1';

    /// 写死
    params['size'] = '1000';

    /// 写死
    params['dictName'] = dictName;

    ///用于搜索
    params['id'] = id;

    /// id = 3 证书类别 写死， 根据获取到 证书 的id 获取 级别
    return HttpClient.getInstance().get(url, params: params);
  }

  /// 精准获客列表
  static Stream jzhkListApi(Map map) {
    return HttpClient.getInstance().get('ahj/v1/refer-customers/company', params: map);
  }

  /// 客户信息列表
  static Stream khxxListApi(Map map) {
    return HttpClient.getInstance().get('ahj/v1/company-extend2/page', params: map);
  }

  /// 查询收藏文件夹
  static Stream foderListApi(Map map) {
    return HttpClient.getInstance().get('ahj/v1/law-collect/folder/find', params: map);
  }

  /// 文件夹详情
  static Stream folderInfoDetailApi(Map map) {
    return HttpClient.getInstance().get('ahj/v1/law-collect/folder/find/files/info/${map['businessId']}', params: map);
  }

  /// 文件夹新增、修改
  static Stream foderAddAndEditApi(Map map) {
    return HttpClient.getInstance().post('ahj/v1/law-collect/folder/add-modify', map);
  }

  /// 文件夹删除
  static Stream foderDelApi(var folderId) {
    return HttpClient.getInstance().delete('ahj/v1/law-collect/folder/remove/${folderId}', params: null);
  }

  /// 文件夹移动
  static Stream foderMoveApi(Map map) {
    return HttpClient.getInstance().put('ahj/v1/law-collect/folder/move/file', map);
  }

  /// 收藏列表
  static Stream fileListApi(Map map) {
    return HttpClient.getInstance().get('ahj/v1/law-collect/folder/find/files/${map['folderId']}', params: map);
  }

  /// 课程列表列表
  static Stream kcListApi(Map map) {
    return HttpClient.getPHPInstance().get('v1/class/list', params: map);
  }

  /// 筛选分类
  static Stream kcFlApi() {
    return HttpClient.getPHPInstance().get('v1/class/list_option', params: null);
  }

  /// 运营商列表
  static Stream yysListApi() {
    return HttpClient.getOpenInstance('zixun').get('ahtc/v1/teamrecruit/operator-select-list', params: null);
  }

  /// 题目列表
  static Stream tmListApi(Map map) {
    return HttpClient.getPHPInstance().post('v1/class/paper_list', map);
  }

  /// 客户申请列表
  static Stream khsqListApi(Map map) {
    String url = map['status'] == '0' ? 'ahj/v1/company-apply/wait-list' : 'ahj/v1/company-apply/audit-list';
    return HttpClient.getInstance().get(url, params: map);
  }

  /// 申请数量
  static Stream applyNumApi() {
    return HttpClient.getInstance().get('ahj/v1/company-apply/num-info', params: null);
  }

  /// 申请
  static Stream applyApi(String companyIds) {
    return HttpClient.getInstance().post('ahj/v1/company-apply/save?companyIds=${companyIds}', null);
  }

  /// 业务类型
  static Stream ywlxApi() {
    return HttpClient.getInstance().get('ahj/v1/company-business-analyse/service-type-num-list', params: null);
  }

  /// 客户风险
  static Stream khfxApi() {
    return HttpClient.getInstance().get('ahj/v1/company-business-analyse/company-risk-num-list', params: null);
  }

  /// 地区获取客户
  static Stream dqkhApi(Map map) {
    return HttpClient.getInstance().get('ahj/v1/company-business-analyse/area', params: map);
  }

  /// 地区获取客户数量省份
  static Stream provinceNumApi(Map map) {
    return HttpClient.getInstance().get('ahj/v1/company-business-analyse/province-num-list', params: map);
  }

  /// 地区获取客户数量城市
  static Stream cityNumApi(Map map) {
    return HttpClient.getInstance().get('ahj/v1/company-business-analyse/city-num-list', params: map);
  }

  /// 客户拜访列表
  static Stream khbfApi(Map map) {
    if (map['bfrw'] == 0) {
      return HttpClient.getInstance().get('ahj/v1/company-visit/visit-task-list', params: map);
    }else {
      return HttpClient.getInstance().get('ahj/v1/company-visit/visit-list', params: map);
    }
  }

  /// 历史拜访
  static Stream khbfHistoryApi(int companyId) {
    var map = {
      'companyId': companyId
    };
    return HttpClient.getInstance().get('ahj/v1/company-visit/record-list', params: map);
  }

  /// 数据统计
  static Stream khSjtjApi(String period) {
    var map = {
      'period': period
    };
    return HttpClient.getInstance().get('ahj/v1/company-data-statistics/data', params: map);
  }

  /// 业务类型客户数据
  static Stream ywlxKhApi(Map map) {
    return HttpClient.getInstance().get('ahj/v1/company-business-analyse/service', params: map);
  }

  /// 客户风险客户数据
  static Stream khfxKhApi(Map map) {
    return HttpClient.getInstance().get('ahj/v1/company-business-analyse/company-risk', params: map);
  }


  
  /// 获取appHttpurl
  static Stream getAppH5Url(String url) {
    return HttpClient.getInstance().get(url,params: null);
  }

  /// 编辑菜单
  static Stream editCaiDanUrl(var map) {
    return HttpClient.getInstance().postList('ahj/v1/module/v3/modify', map);
  }

  /// 点击banner
  static Stream selectBannerUrl(String bannerId) {
    return HttpClient.getOpenInstance('zixun').get('open/v1/banner/add/view/${bannerId}', params: null);
  }

  

  /// 作业类型
  static Stream zylxDataApi() {
    return HttpClient.getInstance().get('platform/v1/expert/work-type', params: null);
  }

  /*
    * 入口获取课程列表
    * */
  static Stream getRKKCList() {
    return HttpClient.getKCInstance().post(zbrkkcListApi, null);
  }

  /*
    * 获取课程分类
    * */
  static Stream getFLList(Map map) {
    return HttpClient.getKCInstance().post(zbkcApi, map);
  }

  /*
    * 获取课程列表
    * */
  static Stream getKCList(Map map) {
    return HttpClient.getKCInstance().post(zbkcListApi, map);
  }

  /*
    * 获取课程详情
    * */
  static Stream getKCDetail(Map map) {
    return HttpClient.getKCInstance().post(zbkcDetailApi, map);
  }

  /*
    * 获取订单号
    * */
  static Stream getKCOrderNo(Map map) {
    return HttpClient.getKCInstance().post(zbkcOrderNoApi, map);
  }

  /*
    * 创建订单
    * */
  static Stream getKCCreatOrder(Map map) {
    return HttpClient.getKCInstance().post(zbkcCreatOrderNoApi, map);
  }

  /*
    * 获取微信支付详情
    * */
  static Stream getKCWechatInfo(Map map) {
    return HttpClient.getKCInstance().post(zbkcWechatInfoApi, map);
  }

  /// /v1/ahj/users/operation
  /// 获取当前所属运营中心
  /// get
  static Stream usersOperation() {
    String url = users_operation;

    return HttpClient.getInstance().get(url);
  }

  /// /v1/ahj/users/my/poster
  /// 获取海报
  /// get
  static Stream poster(Map map) {
    String url = poster_url;
    return HttpClient.getInstance().get(url, params: map);
  }

  /// 获取供应商信息
  static Stream gysInfo() {
    String url = gysInfo_url;
    return HttpClient.getInstance().get(url, params: {});
  }

  /// 获取用户角色
  static Stream getUserRole() {
    String url = getUserRole_url;
    return HttpClient.getInstance().get(url, params: {});
  }
  /*
    * 网校CheckToken
    * */
  static Stream getCheckToken(Map map) {
    return HttpClient.getKCInstance().post(HttpKCBaseConst.serverUrl+ "V1/token/change", map);
  }

  /// /v1/insurance-center/company
  /// 企业账号选择下拉列表
  /// get
static Stream getInsuranceCenterCompany() {
    String url = insuranceCenterCompany;
    return HttpClient.getInstance().get(url,);
  }

  // /// 作业类型
  // static Stream zylxDataApi() {
  //   return HttpClient.getInstance().get('platform/v1/expert/work-type', params: null);
  // }

  /// /v1/insurance-type/company
  /// 企业账号选择下拉列表
  /// get
static Stream getinsuranceTypeCompany() {
    String url = insuranceTypeCompany;
    return HttpClient.getInstance().get(url,);
  }

  /// /v1/precautionstatisitcs/risk/{companyId}
/// 查询风险信息
/// get
static Stream getPrecautionstatisitcs({int companyId}) {
  // var params = {
  //   'companyId':companyId
  // };
    String url = precautionstatisitcs+companyId.toString();
    return HttpClient.getInstance().get(url);
  }

  ///使用权限是否过期
  static Stream checkTime(String id, String type) {
    Map<String, String> map = new Map();
    map["peopleType"] = type;
    String url = "admin/v1/ahj/timeSetting/$id";
    return HttpClient.getInstance().get(url, params: map);
  }

  ///资讯头部tabars
  static Stream getCategoryStatus() {
    String url = 'open/v1/cms/category';
    return HttpClient.getOpenInstance('zixun').get(url);
  }

  ///资讯列表
  static Stream getCmsNewsList(Map map) {
    String url = 'open/v1/cms/news/list';
    return HttpClient.getOpenInstance('zixun').get(url, params: map);
  }

  ///资讯列表详情
  static Stream getCmsNewsDetail(Map map) {
    String url = 'open/v1/cms/news';
    return HttpClient.getOpenInstance('zixun').get(url, params: map);
  }

  ///我的团队
  static Stream getMyTeamMembers(Map map) {
    String url = 'ahtc/v1/teamrecruit/getMyTeamMembers';
    return HttpClient.getOpenInstance('zixun').get(url, params: map);
  }

  ///获取队员数量和待审核队员数量
  static Stream getLeaderTeamDetail(Map map) {
    String url = 'ahtc/v1/teamrecruit/getLeaderTeamDetail';
    return HttpClient.getOpenInstance('zixun').get(url, params: map);
  }

  ///队长页面待审核列表页面
  static Stream getleaderAuditList(Map map) {
    String url = 'ahtc/v1/teamrecruit/leaderAuditList';
    return HttpClient.getOpenInstance('zixun').get(url, params: map);
  }

  ///队员申请入队申请
  static Stream postApplyJoinMember(Map map) {
    String url = 'ahtc/v1/teamrecruit/applyJoinMember';
    return HttpClient.getOpenInstance('zixun').post(url, map);
  }

  ///获取积分
  static Stream getUserQueryApi() {
    String url = 'admin/v1/member/integral/query';
    return HttpClient.getOpenInstance('zixun').get(url, params: null);
  }

  ///是否加入团队
  static Stream getsTeamJoined() {
    String url = 'ahtc/v1/teamrecruit/isTeamJoined';
    return HttpClient.getOpenInstance('zixun').get(url);
  }

  ///队长审核与驳回队员入队申请
  static Stream postLeaderAuditMember(Map map) {
    String url = 'ahtc/v1/teamrecruit/leaderAuditMember';
    return HttpClient.getOpenInstance('zixun').post(url, map);
  }

  ///队员详情信息
  static Stream getMemberDetail(Map map) {
    String url = 'ahtc/v1/teamrecruit/memberDetail';
    return HttpClient.getOpenInstance('zixun').get(url, params: map);
  }

  ///获取团队详情
  static Stream getTeamInfoByTeamId(Map map) {
    String url = 'ahtc/v1/teamrecruit/getTeamInfoByTeamId';
    return HttpClient.getOpenInstance('zixun').get(url, params: map);
  }

  ///运营商列表
  static Stream getOperatorList() {
    String url = 'ahtc/v1/teamrecruit/operator-select-list';
    return HttpClient.getOpenInstance('zixun').get(url);
  }

  ///运营商团队列表
  static Stream getOperatorTeams(Map map) {
    String url = 'ahtc/v1/teamrecruit/getOperatorTeams';
    return HttpClient.getOpenInstance('zixun').get(url, params: map);
  }

  ///订单列表
  static Stream getOrderList(Map map) {
    String url = 'ahtc/v1/teamrecruit/promotion/order/list';
    return HttpClient.getOpenInstance('zixun').get(url, params: map);
  }

  ///获取签署信息
  static Stream getQianShuInfo() {
    String url = 'ahtc/v1/teamrecruit/promotion/order/citicUser';
    return HttpClient.getOpenInstance('zixun').get(url, params: null);
  }

  ///申请团队长
  static Stream getApplyJoinLeader(Map map) {
    String url = 'ahtc/v1/teamrecruit/applyJoinLeader';
    return HttpClient.getOpenInstance('zixun').post(url, map);
  }

  ///申请记录
  static Stream getApplyRecord() {
    String url = 'ahtc/v1/teamrecruit/applyRecord';
    return HttpClient.getOpenInstance('zixun').get(url);
  }

  ///是否存在专家认证记录
  static Stream getIsExistCer() {
    String url = 'ahtc/v1/expert/exist';
    return HttpClient.getOpenInstance('zixun').get(url);
  }
  ///查询认证状态详情
  static Stream getBaseDetailById(String auId) {
    String url = 'ahtc/v1/expert/baseDetailById';
    Map<String, String> map = new Map();
    map["id"] = auId;
    return HttpClient.getOpenInstance('zixun').get(url, params: map);
  }

}
